export default {
	state: {
		trajectoryId: 0,
		pointArr: [],
		status: false,

	},
	mutations: {
		setStatus(state, status) {
			state.status = status;
		},
		setTrajectoryId(state, id) {
			state.trajectoryId = id;
		},
		setPointArr(state, arr) {
			state.pointArr = arr;
		},
		addPoint(state, point) {
			state.pointArr.push(point);
		},
		clearPointArr(state) {
			state.pointArr = [];
		},
		removePoint(state, index) {
			state.pointArr.splice(index, 1);
		},
		updatePoint(state, {index, point}) {
			state.pointArr.splice(index, 1, point);
		},



	},
	actions: {
		setStatus(context, status) {
			context.commit('setStatus', status);
		},
		setTrajectoryId(context, id) {
			context.commit('setTrajectoryId', id);
		},
		setPointArr(context, arr) {
			context.commit('setPointArr', arr);
		},
		addPoint(context, point) {
			context.commit('addPoint', point);
		},
		clearPointArr(context) {
			context.commit('clearPointArr');
		},
		removePoint(context, index) {
			context.commit('removePoint', index);
		},
		updatePoint(context, {index, point}) {
			context.commit('updatePoint', {index, point});
		},


	}
}